﻿namespace MicroCloud.Entity.Database
{
    /// <summary>
    /// 功能信息实体映射配置
    /// </summary>
    public class FunctionConfiguration : EntityTypeConfigurationBase<Function, long>
    {
        /// <summary>
        /// 重写以实现实体类型各个属性的数据库配置
        /// </summary>
        /// <param name="builder">实体类型创建器</param>
        public override void Configuration(EntityTypeBuilder<Function> builder)
        {
            builder.HasIndex(m => m.Name).SetIndex("Name");
            builder.HasIndex(m => new { m.Area, m.Controller, m.Action }).SetIndex("AreaControllerAction", true).HasFilter(null);

            ConfigurationAppend(builder);
        }

    }
}